<../../../mkconfig

CONF=sds				#default configuration
SYSTARG=$OSTARG
OBJTYPE=arm #thumb

<$ROOT/mkfiles/mkfile-$SYSTARG-$OBJTYPE	#set vars based on target system

KTZERO7=0x03800000

OFILES=\
	l.$O\
	main.$O\
	trap.$O\
	spi.$O\
	rtc.$O\
	audio.$O\
	wifi.$O\
	print.$O\
#	dma.$O\

HFILES=\
	../io.h\
	../mem.h\
	fns.h\
	spi.h\
	audio.h\
	wifi.h\
	
LIBS=\
	kern\

CFLAGS=-wFV -I $ROOT/Inferno/arm/include -I $ROOT/include -r

default:V: i$CONF

i$CONF: $OFILES
	$LD -o $target -R4 -T$KTZERO7 -l $OFILES $libs $SYSLIBS

# must be ARM code, even when OBJTYPE=thumb
trap.t: trap.5
	cp trap.5 trap.t
%.5: %.c
	5c $CFLAGS $stem.c

syms:   $OFILES
	$CC $CFLAGS -a '-DKERNDATE='$KERNDATE main.c >syms

vclean:V: clean
	rm -f syms
	rm -f i$CONF i$CONF.*

<$ROOT/mkfiles/mkone-$SHELLTYPE
